package jdk8demo.interfacefunction;

import java.util.Objects;
import java.util.function.Predicate;

//前面的函数式接口都是自定义的，JDK内置的函数是接口
//断言只有⼀一个参数，返回boolean类型
public class PredicateDemo {
	public static void main(String[] args) {
		Predicate<String> isEmpty = str -> str.isEmpty();
		System.out.println(isEmpty.test(""));

		Predicate<String> isNull = Objects::nonNull; // s-> s != null;
		System.out.println(isNull.test(null));

		Predicate<Boolean> bool = Boolean::booleanValue;
		System.out.println(bool.test(10 > 16));// false
	}
}
